import request from '@/util/request';

//获取admin详情
export const adminListWithConditionService=(params)=>{
    return request.get('/admin',{params: params});
}
//添加admin
export const adminAddService =(adminData)=>{
    return request.post('/admin',adminData)
}
//修改admin
export const adminEditService =(adminData)=>{
    return request.put('/admin',adminData)
}
//删除admin
export const adminDeleteService =(id)=>{
    return request.delete('/admin?id='+id)
}
//修改admin
export const adminChangeStateService =(status,adminid)=>{
    return request.put('/admin',status,adminid)
}



//注册请求
export const adminRegisterService = (registerData)=>{
    const params = new URLSearchParams();
    for(let key in registerData){
        params.append(key,registerData[key]);
    }
    return request.post('/admin/register',params);
}
//登录请求
export const adminLoginService = (loginData)=>{
    const params = new URLSearchParams();
    for(let key in loginData){
        params.append(key,loginData[key]);
    }
    return request.post('/admin/login',params);
}
//获取管理员详细信息请求
export const adminInfoGetService=()=>{
    return request.get('/admin/adminInfo');
} 
// //修改管理员
// export const adminEditService=(adminInfo)=>{
//     return request.put('/admin/update',adminInfo);
// }